grammar CommandePattern;



@lexer::members {

    String Mytest = "";



}

@parser::members {
   public   models.requete Owner;
}


@header {
package grammar;
import java.util.ArrayList;
}

@rulecatch {
catch (RecognitionException e) {
//System.out.println( e.getClass().getCanonicalName());
//System.out.println(super.getErrorMessage(e, tokenNames));
 String mess = super.getErrorMessage(e, tokenNames);
 if (e instanceof NoViableAltException)  {
 //throw new NoViableAltException(mess,0,0,e.input);

 }
 else

// throw e;
// throw new Error(super.getErrorMessage(e, tokenNames)) ;
 // throw new parseException(super.getErrorMessage(e, tokenNames));
// throw e;
}
}




OPERATOR:
    'PING';

eval :
    (command)+;
    catch[RecognitionException e] { }


command :
    op=OPERATOR {if (this.Owner != null) this.Owner.commande = $op.getText();}|
    LINE_COMMENT;


LINE_COMMENT
    : '#' ~[\r\n]* '\r'? '\n' -> channel(HIDDEN)
    ;

WS : [ \r\t\n]+ -> skip ;



